import instance from "../utils/request";
/**
 * 获取商品分类列表
 * @param params 
 * @returns 
 */
export const getShopSort = (params: any) => instance.get("/api/v1/admin/productcategory", { params });

export const getSort=(id:string)=>instance.get("/api/v1/admin/productcategory/"+id)
/**
 * 新增一个商品分类
 * @param data 
 * @returns 
 */
export const addShopSort = (data: any) => instance.post("/api/v1/admin/productcategory", data);
/**
 * 根据id删除商品分类
 * @param id 
 * @returns 
 */
export const delShopSort = (id: string) => instance.delete("/api/v1/admin/productcategory/" + id);
/**
 * 根据id修改数据
 * @param id 
 * @returns 
 */
export const putShopSort = (id: string, data: any) => instance.put("/api/v1/admin/productcategory/" + id, data);

/**
 * 商品数据
 */
/**
 * 获取商品列表
 * @param params 
 * @returns 
 */
export const getShop = (params: any) => instance.get("/api/v1/admin/product", { params });
/**
 * 修改数据时调用
 * @param id 
 * @returns 
 */
export const getShopById = (id:string) => instance.get("/api/v1/admin/product/"+ id);
/**
 * 新增商品数据
 * @param data 
 * @returns 
 */
export const addShop = (data: any) => instance.post("/api/v1/admin/product", data);
/**
 * 删除商品数据
 * @param id 
 * @returns 
 */
export const delShop = (id: string) => instance.delete("/api/v1/admin/product/" + id);
/**
 * 修改商品数据
 * @param id 
 * @returns 
 */
export const putShop = (id: string,data:any) => instance.put("/api/v1/admin/product/" + id,data);